<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>分配权限</title>
	<meta name="decorator" content="blank"/>
	<script type="text/javascript">
	$(function(){
		$("#authTable").find("input[type='checkbox']:checked").each(function(){
			$(this).removeAttr("checked");
		});
		var backCode = $("#code").val();
		if((backCode & 16) ==16){
			$("#code16").attr("checked","checked");
		}
		if((backCode & 8) ==8){
			$("#code8").attr("checked","checked");
		}
		if((backCode & 4) ==4){
			$("#code4").attr("checked","checked");
		}
		if((backCode & 2) ==2){
			$("#code2").attr("checked","checked");
		}
		if((backCode & 1) ==1){
			$("#code1").attr("checked","checked");
		}
	});
	var code = 0;
	function cacl(){
		$("#authTable").find("input[type='checkbox']:checked").each(function(){
			code+=parseInt($(this).val());
		});
	}
	</script>
	<style type="text/css">	  
	  .row{
	  	padding: 6px 20px;
	  	margin: 0;
	  	border-bottom: 1px solid #ccc;
	  }
	  .col-md-4 {
	  	 float: left;
	     width: 20%;
	  }
	  .col-md-8 {
	  	float: right;
	  	width:79%
	  }
	</style>
</head>
<body>
	<div id="assignAuth">
		<div class="row">
        	<div class="col-md-4">项目：</div>
        	<div class="col-md-8">${project.name}</div>
        </div>	
        <div class="row">
        	<div class="col-md-4">人员：${user.name}</div>
            <div class="col-md-8" id="authTable">
				<label class="checkbox-inline">
				  <input type="hidden" id="code" value="${projectUser.code}"/>
	              <input id="code16" type="checkbox" value="16"/>项目修改
				</label>
				<label class="checkbox-inline">
					<input id="code8" type="checkbox" value="8"/>添加成员
				</label>
				<label class="checkbox-inline">
					<input id="code4" type="checkbox" value="4"/>移除成员
				</label>
				<label class="checkbox-inline">
					<input id="code2" type="checkbox" value="2"/>项目修改
				</label>
				<label class="checkbox-inline">
					<input id="code1" type="checkbox" value="1"/>任务组修改
				</label>
            </div>
  
		</div>
    </div>
</body>
</html>
